package com.chenjt.netty.five_thrift;

import com.chenjt.netty.five_thrift.generated.DataException;
import com.chenjt.netty.five_thrift.generated.Person;
import com.chenjt.netty.five_thrift.generated.PersonService;
import org.apache.thrift.TException;

/**
 * 注释：
 *
 * @author chenjt
 * @date 2024/8/12 14:44
 */
public class PersonServiceImpl implements PersonService.Iface {

    @Override
    public Person getPersonByUsername(String username) throws DataException, TException {
        System.out.println("Get Client Param: " + username);

        Person person = new Person();
        person.setUsername(username);
        person.setAge(20);
        person.setMarried(false);

        return person;
    }

    @Override
    public void savePerson(Person person) throws DataException, TException {

        System.out.println("Get Client Param: ");

        System.out.println(person.getUsername());
        System.out.println(person.getAge());
        System.out.println(person.isMarried());

    }
}
